package base;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.thread switch")
public class ThreadSwitch {
    public static void main(String[] args) {
        new Thread(()->{
            while (true){
                log.debug("running");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"t1").start();

        new Thread(()->{
            while (true){
                log.debug("running");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"t2").start();
    }
}
